﻿package roleView 
{
	import flash.display.Bitmap;
	import flash.display.DisplayObject;
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.events.Event;
	
	/**
	 * ...
	 * @author Kylin206
	 */
		
	
	public class Skin extends BmpSprite 
	{
		private var roleId:uint = 0;
		private var col:uint = 0;
		private var scale:Number = 1;
		private var _act:String = ActClassNames.STAND;
		private var _equip:uint = 0;
		private var mov:BitmapMovie;
		
		private var isTemMode:Boolean = false;
		private var temFrameI:uint = 0;
		private var temMC:MovieClip;
		private var temBMP:Bitmap;
		private var temFrameInfo:Vector.<BitmapFrameInfo>;
		
		public function Skin(roleId:uint, col:uint, scale:Number = 1)
		{
			//this.transform.matrix3D = new Matrix3D();//强制平滑
			
			this.roleId = roleId;
			this.col = col;
			this.scale = scale;
			showAct(ActClassNames.STAND);
		}
		
		public function equipItem(equip:uint, drawNow:Boolean = true):void
		{
			this._equip = equip;
			id = "h" + roleId + "_" + _equip + "_" + col + "_" + act;
			if (drawNow) draw();
		}
		
		public function showAct(act:String, drawNow:Boolean = true):void
		{
			this._act = act;
			id = "h" + roleId + "_" + _equip + "_" + col + "_" + act;
			if (drawNow) draw();
		}
		
		
		override protected function getSrc():DisplayObject
		{
			return SkinPool._getRoleSkin(roleId, _equip, col, act);;
		}
		
		public function get act():String
		{
			return _act;
		}
		
		override public function toString():String 
		{
			return "[Skin_" + roleId + "] act =" + act;
		}
	}
}

